package top.tenebrous.termbor.rpc.consumer.nativeTest.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.tenebrous.termbor.rpc.api.HelloService;
import top.tenebrous.termbor.rpc.common.annotation.RpcReference;
import top.tenebrous.termbor.rpc.consumer.RpcClient;
import top.tenebrous.termbor.rpc.consumer.nativeTest.service.ClientHelloService;

import javax.annotation.Resource;

/**
 * @program: jestic-rpc
 * @description:
 * @author: yazhang6
 * @create: 2024-05-10 09:19
 **/
@Service
public class ClientHelloServiceImpl implements ClientHelloService {

//    @RpcReference(registryType = "nacos", registryAddress = "127.0.0.1:8848",version = "1.0.0", group = "jestic")
//    private HelloService helloService;

    @Resource
    private RpcClient rpcClient;

    @Override
    public String notice(String context) {
        for (int i = 0; i < 1000; i++) {
            rpcClient.create(HelloService.class).sayHello(context + "---" + i+i+i);
        }
        return "SUCCESS";
    }

}
